<div class="bjui-pageHeader">
    <form id="pagerForm" data-toggle="ajaxsearch" action="${request.getContextPath()}/OrderStatusAnalysis/orderStatusAnalysisStep" method="post">
        <div class="bjui-searchBar">
            <g:hiddenField name="SYS_QUERY_NAME" value="orderStatusAnalysisStep" />
            <g:hiddenField name="EXPORT_CONTENT_NAME" value="Excel" />
            <g:hiddenField name="docId1" value="${params.docId1}"/>
            <g:hiddenField name="scrap1" value="${params.scrap1}"/>
            <g:hiddenField name="lineNum" value="${params.lineNum}"/>
            <label >工序：</label>&nbsp;
        <g:select name="step" from="${orderStatusAnalysisScrapStepNameList}" data-toggle="selectpicker" data-live-search="true" optionKey="step" optionValue="step" value="${step}" noSelection="['':'ALL']" />&nbsp;
            <button type="submit" class="btn-default" data-icon="search">查询</button>&nbsp;
            <button type="button" class="btn-blue" onclick="javascript:bjuiExportExl('#pagerForm','${request.getContextPath()}/StageWip/exportExcel')" data-icon="file-excel-o" title="导出Excel">导出</button>&nbsp;
        </div>
    </form>
</div>

<div class="panel-body">
    <div style="mini-width:400px;height:450px;" id="cellGlassOutputDiv"></div>
</div>

<div class="bjui-pageContent">
    <g:if test="${orderStatusAnalysisScrapStep.size() > 0}">
        <table  data-toggle="tablefixed" data-width="100%" data-nowrap="true">
            <thead>
            <tr id="t1">
                <g:each in="${tableHeadList}" status="j" var="headInstance">
                    <g:if test="${headInstance!='RN'}">
                        <th  width="125"><g:message code="${headInstance}" default="${headInstance}"/></th>
                    </g:if>
                </g:each>
            </tr>
            </thead>
            <tbody>
            <g:if test="${orderStatusAnalysisScrapStep.size()>0}">
                <g:each in="${orderStatusAnalysisScrapStep}" status="i" var="dataInstance">
                    <tr>
                        <g:each in="${tableHeadList}" status="j" var="headInstance">
                            <g:if test="${headInstance=='MAIN_QTY'&&headInstance!='RN'}">
                                <td name="qty${i}"><a href="${request.getContextPath()}/OrderStatusAnalysis/OrderStatusAnalysisStepTwo?docId1=<%=dataInstance.DOC_ID%>&step=<%=dataInstance.STEP_NAME%>&scrap=SCRAP&lineNum1=<%=params.lineNum%>" data-toggle="navtab"  data-id="dialog-normal" data-options="{id:'orderStatusAnalysisStepTwo', title:'订单状况分析表批次信息'}">${dataInstance["${headInstance}"]}</a></td>
                            </g:if>
                            <g:elseif test="${headInstance!='RN'}">
                                <td>${dataInstance["${headInstance}"]}</td>
                            </g:elseif>
                        </g:each>
                    </tr>
                </g:each>
                <tr>
                    <td colspan="6">小计(当前页)</td>
                    <td name="sum">0</td>
                </tr>
                <tr>
                    <td colspan="6">合计(总)</td>
                    <td >${orderStatusAnalysisScrapStepSum[0].SUM_QTY}</td>
                </tr>
            </g:if>
            <g:else>
                <g:render template="../template/emptyPanel" />
            </g:else>
            </tbody>
        </table>
    </g:if>
</div>
<g:render template="../template/51pagination" />
<script>
    $(function(){
        var s=0;
        for(var i=0;i<${orderStatusAnalysisScrapStep.size()};i++){
            var s1='qty'+i
            var sumS=$("td[name='"+s1+"']").text()==''?0:parseInt($("td[name='"+s1+"']").text())
            s+=sumS


        }
        $("td[name='sum']").html(s)

    })
</script>
